<?php
define('IN_ECS', true);
require('includes/init.php');
include_once('comm.php');
extract($_POST);
//$FMUID = $_SESSION['user_id'];
$result = "failure";
$sql = "SELECT * FROM `fmmaked` WHERE id=$id ";
$data1 = $GLOBALS['db']->getRow($sql);
$img = '';
$thu = '';
$tmp = array();
foreach($data1 as $d){
    $tmp[] = $d;
}
$img = '..'.$tmp[0]['url'];
$thu = '..'.$tmp[0]['thumb'];

if(file_exists($img)){
   unlink($img);
}
if(file_exists($thu)){
   unlink($thu);
}


//ɾ����ݿ��е���Ϣ
$query = "DELETE FROM `fmmaked` WHERE id=$id ";
//$query = "DELETE FROM `fmmaked` WHERE id=$id ";
$re = $GLOBALS['db']->query($query);
if($re){
	$result = "success";
}else{
	$result = "failure";
}

$d = "<root><info><result>".$result."</result></info></root>";
echo $d;
?>
